{% extends "main/base.html" %}
{% load static i18n main_tag %}
{% block title %}{% trans '上传订单文件' %}{% endblock %}
{% block this_css %}
<link href="{% static 'flatlab/assets/dropzone/css/dropzone.css' %}" rel="stylesheet"/>
{% endblock %}
{% block content %}
<div class="panel">
    <header class="panel-heading">
        {% trans "上传订单文件" %}
        {% if form.errors %}
        <p>{% trans "提交的数据有误,请认真检查!" %}</p>
        {% endif %}
    </header>
    <div class="panel-body">
        <form method="post" enctype="multipart/form-data" class="form-horizontal">{% csrf_token %}
            {{ form.non_field_errors }}
            <input type="hidden" name="created_by" id="id_created_by" value="{{ request.user.id }}">
            <div class="clearfix"></div>
            <div class="form-group col-md-9">
                <div class="col-sm-2">{{ form.order_code.label_tag }}</div>
                <div class="col-sm-10">{{ form.order_code }}{{ form.order_code.errors }}</div>
            </div>
            <div class="clearfix"></div>
            <div class="form-group col-md-9">
                <div class="col-sm-2">{{ form.order_desc.label_tag }}</div>
                <div class="col-sm-10">{{ form.order_desc }}{{ form.order_desc.errors }}</div>
            </div>
            <div class="form-group col-md-9">
                <div class="col-sm-2">{{ form.order_file.label_tag }}</div>
                <div class="col-sm-8">{{ form.order_file }}{{ form.order_file.errors }}</div>
                <div class="col-sm-2">{% if object.order_file %}<a href="{{ object.order_file|qiniu }}" target="_blank"><span class="btn btn-info btn-xs">当前报价单</span></a>{% endif %}</div>
            </div>
            <div class="clearfix"></div>
            <div class="form-group col-md-9">
                <div class="col-sm-2">{{ form.order_file_c.label_tag }}</div>
                <div class="col-sm-8">{{ form.order_file_c }}{{ form.order_file_c.errors }}</div>
                <div class="col-sm-2">{% if object.order_file_c %}<a href="{{ object.order_file_c|qiniu }}" target="_blank"><span class="btn btn-info btn-xs">当前合同</span></a>{% endif %}</div>
            </div>
            <div class="form-group col-md-12" align="right">
                <button type="submit" class="btn btn-danger" value="Update">{% trans "提交" %}</button>
            </div>
        </form>
    </div>
</div>
{% endblock %}
{% block this_js %}
<script type="text/javascript" src="{% static 'flatlab/assets/dropzone/dropzone.js' %}"></script>
{% endblock %}